/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package botsim;

import com.bulletphysics.collision.broadphase.AxisSweep3;
import com.bulletphysics.collision.broadphase.BroadphaseInterface;
import com.bulletphysics.collision.dispatch.CollisionConfiguration;
import com.bulletphysics.collision.dispatch.CollisionDispatcher;
import com.bulletphysics.collision.dispatch.DefaultCollisionConfiguration;
import com.bulletphysics.collision.shapes.CollisionShape;
import com.bulletphysics.collision.shapes.StaticPlaneShape;
import com.bulletphysics.dynamics.DiscreteDynamicsWorld;
import com.bulletphysics.dynamics.DynamicsWorld;
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver;
import com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolver;
import com.bulletphysics.linearmath.DefaultMotionState;
import javax.vecmath.Vector3f;

/**
 *
 * @author Prasanna Velagapudi <pkv@cs.cmu.edu>
 */
public class Main {
/*
    CollisionDispatcher myCd;
    BroadphaseInterface myBi;
    ConstraintSolver myCs;
    CollisionConfiguration myCc;
    DynamicsWorld myWorld;

    Vector3f worldAabbMin = new Vector3f(-10000,-10000,-10000);
    Vector3f worldAabbMax = new Vector3f(10000,10000,10000);

    void setup(){      
      myCc = new DefaultCollisionConfiguration();
      myBi = new AxisSweep3(worldAabbMin, worldAabbMax);
      myCd = new CollisionDispatcher(myCc);
      myCs = new SequentialImpulseConstraintSolver();

      myWorld = new DiscreteDynamicsWorld(myCd, myBi, myCs, myCc);
      myWorld.setGravity(new Vector3f(0,-10,0));

      //ADD STATIC GROUND
      CollisionShape groundShape = new StaticPlaneShape(new Vector3f(0,1,0), 1); //1 m thick under ground
      RigidBodyConstructionInfo groundCI = new RigidBodyConstructionInfo(0, groundMotionState, groundShape, new Vector3f(0,0,0));
      RigidBody groundRigidBody = new RigidBody(groundCI);
      myWorld.addRigidBody(groundRigidBody);

      //ADD FALLING SPHERE
      CollisionShape fallShape = new SphereShape(1);
      myTransform = new Transform(); myTransform.origin.set(new Vector3f(0,50,0)); myTransform.setRotation(new Quat4f(0,0,0,1));
      DefaultMotionState fallMotionState = new DefaultMotionState(myTransform);
      float myFallMass = 1; Vector3f myFallInertia = new Vector3f(0,0,0);
      fallShape.calculateLocalInertia(myFallMass, myFallInertia);
      RigidBodyConstructionInfo fallRigidBodyCI = new RigidBodyConstructionInfo(myFallMass, fallMotionState, fallShape, myFallInertia);
      fallRigidBody = new RigidBody(fallRigidBodyCI);
      myWorld.addRigidBody(fallRigidBody);
    }

    void draw(){
       myWorld.stepSimulation(1.0/60.0,8);

       myTransform = new Transform();
       myTransform = fallRigidBody.getMotionState().getWorldTransform(myTransform);

       //background(#FFFFFF);
       ellipse(frameCount, myTransform.origin.y*5, 2,2);
       println(myTransform.origin.y);
    }
*/
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }
}
